package com.rbac.api.controller.enums;


import com.rbac.i18n.utils.I18nUtils;

public enum HintMessageEunm {
    EXCEPTION_SUCCESS_DEFAULT(0L, "操作成功~"),
    EXCEPTION_PARAMETER_DEFAULT_ERROR(1L, "参数错误"),

    EXCEPTION_H_PARAME_ERROR_EXCEPTION(101L, "h参数错误"),
    EXCEPTION_H_NO_LOGIN_ERROR_EXCEPTION(102L, "h请先登录"),
    EXCEPTION_H_DATA_ANALYSIS_ERROR(106L, "h数据解析失败"),
    EXCEPTION_H_TOKEN_PARAME_ERROR_EXCEPTION(107L, "hToken参数错误"),
    EXCEPTION_H_GET_TOKEN_ERROR_EXCEPTION(108L, "h获取Token失败"),
    EXCEPTION_H_REDIS_GET_INFO_EXCEPTION(109L, "hRedis个人资料获取失败"),
    EXCEPTION_H_DB_GET_INFO_EXCEPTION(110L, "hDb个人资料获取失败"),
    EXCEPTION_H_INFO_INCONSISTENT_EXCEPTION(111L, "hDB账号信息不一致"),


    EXCEPTION_P_MENU_NOT_EXISTS_ERROR_EXCEPTION(1000L, "p访问地址不存在"),
    EXCEPTION_P_NOT_HAVE_ROLES_ERROR_EXCEPTION(1001L, "p请联系管理员分配权限"),


    EXCEPTION_SERVICE_FOUR_HUNDRED_ERROR(5000L, "服务器400错误"),
    EXCEPTION_SERVICE_ABNORMAL_ERROR(5001L, "服务器异常"),
    EXCEPTION_ACTION_ABNORMAL_ERROR(5002L, "操作产生异常"),
    EXCEPTION_DATA_NOT_EXISTS_ERROR_DEFAULT(5003L, "操作的数据不存在"),

    EXCEPTION_PASSWORD_LENGTH_ERROR(10000L, "密码长度请保持在6到16位之间"),
    EXCEPTION_ACCOUNT_NOT_EXISTS_ERROR(10001L, "账号或密码错误"),
    EXCEPTION_ACCOUNT_ALREADY_FROZEN_ERROR(10002L, "此账号已经被冻结"),
    EXCEPTION_ACCOUNT_OR_PASSWORD_ERROR(10003L, "账号或密码错误"),
    EXCEPTION_NOT_HAVE_ANY_MENU_POWER_ERROR(10004L, "没有任何菜单权限，请联系管理员分配"),
    EXCEPTION_ADD_NEW_ADMIN_ERROR(10005L, "新增管理员异常"),
    EXCEPTION_ACCOUNT_ALREADY_EXISTENCE_ERROR(10006L, "此账号已经存在"),
    EXCEPTION_SAVE_MY_PASSWORD_ERROR(10007L, "修改密码产生异常"),


    EXCEPTION_OUT_ACTION_ERROR(11000L, "退出失败"),






    EXCEPTION_ERROR_DEFAULT(999999L, "操作失败~");


    long id;

    String name;

    String i18nCode;
    String[] i18nParam;

    HintMessageEunm(long id, String name) {
        this.id = id;
        this.name = name;
    }

    HintMessageEunm(long id, String name, String i18nCode) {
        this.id = id;
        this.name = name;
        this.i18nCode = i18nCode;
    }

    HintMessageEunm(long id, String name, String i18nCode, String... param) {
        this.id = id;
        this.name = name;
        this.i18nCode = i18nCode;
        this.i18nParam = param;
    }


    public long getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getI18nCode() {
        return i18nCode;
    }

    public void setI18nCode(String i18nCode) {
        this.i18nCode = i18nCode;
    }

    public String[] getI18nParam() {
        return i18nParam;
    }

    public void setI18nParam(String[] i18nParam) {
        this.i18nParam = i18nParam;
    }

    public String getI18nMsg(String[] args) {
        return I18nUtils.getMsg("exception_" + this.getId());
    }


}
